home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / network / manageme / tcpdump-.7 / tcpdump- / tcpdump-richard-1.7 / tcpdump-3.0 / Makefile.in < prev    next >
Encoding:
Makefile  |  1995-04-17  |  6.0 KB  |  187 lines

  1. #  Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994
  2. #     The Regents of the University of California.  All rights reserved.
  3. #
  4. #  Redistribution and use in source and binary forms, with or without
  5. #  modification, are permitted provided that: (1) source code distributions
  6. #  retain the above copyright notice and this paragraph in its entirety, (2)
  7. #  distributions including binary code include the above copyright notice and
  8. #  this paragraph in its entirety in the documentation or other materials
  9. #  provided with the distribution, and (3) all advertising materials mentioning
  10. #  features or use of this software display the following acknowledgement:
  11. #  ``This product includes software developed by the University of California,
  12. #  Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
  13. #  the University nor the names of its contributors may be used to endorse
  14. #  or promote products derived from this software without specific prior
  15. #  written permission.
  16. #  THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  17. #  WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  18. #  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  19. #
  20. # @(#) $Header: Makefile.in,v 1.152 94/06/16 20:55:40 leres Exp $ (LBL)
  21.  
  22. #
  23. # You might want to edit these path names.
  24. #
  25.  
  26. # Full pathname of where to install the binaries
  27. BINDEST = /usr/local/bin/tcpdump
  28. # Full pathname of where to install the manual entries
  29. MANDEST = /usr/local/man/man1/tcpdump.1
  30.  
  31. #
  32. # You shouldn't need to edit anything below here.
  33. #
  34.  
  35. # Possible Options:
  36. #  -DCSLIP    include support for kernel slip interface
  37. #  -DPPP    include support for point to point protocol
  38. #  -DIBMRTPC    enable the MERIT additions to the Stanford Enetfilter
  39. #  -DDECNETLIB    use the optional DECnet library under Ultrix and others
  40. #  -DNOVFPRINTF    simulate vfprintf() on systems that don't have it
  41. #
  42. # CSLIP and PPP work only under BPF.
  43. #
  44.  
  45. #have-cslip#CSLIP_DEFINES = -DCSLIP
  46. #have-dnet#DNET_DEFINES = -DDECNETLIB
  47.  
  48. # CFLAGS definitions per machine vs. os
  49. #mips-irix4#MD_OS_CFLAGS = -xansi -D__STDC__ -Dinline=
  50. #mips-irix5#MD_OS_CFLAGS = -xansi -D__STDC__ -Dinline= -D_BSD_SIGNALS
  51. #rt-bsd#MD_OS_CFLAGS = -U__STDC__ -DNOVFPRINTF
  52.  
  53. #have-ethers#ETHERS_DEFINES = -DETHER_SERVICE
  54.  
  55. #have-solaris#OS_DEFINES = -DSOLARIS
  56. #have-linux#OS_DEFINES = -DLINUX
  57. #have-linux#OS_INCLUDES = -I../linux-include
  58.  
  59. CCOPT = -O2
  60. INCLUDES = -Ilibpcap -I/usr/local/include $(OS_INCLUDES)
  61. OPTIONAL_DEFINES = $(ETHERS_DEFINES) $(DNET_DEFINES) $(OS_DEFINES)
  62. DEFINES = $(CSLIP_DEFINES) -DPPP -DFDDI $(OPTIONAL_DEFINES)
  63.  
  64. # Standard CFLAGS
  65. CFLAGS = $(CCOPT) $(DEFINES) $(INCLUDES) $(MD_OS_CFLAGS)
  66.  
  67. # Optional libraries as available
  68. #have-dnet#DNET_LIBS = -ldnet
  69.  
  70. # Optional libraries per machine vs. os
  71. #sun4-sunos5#MD_OS_LIBS = -lsocket -lnsl
  72. #alpha-osf1v1#MD_OS_LIBS = /usr/examples/packetfilter/pfopen.c
  73. #alpha-osf1v2#MD_OS_LIBS =
  74.  
  75. # Standard LIBS
  76. LIBS = -Llibpcap -L/usr/local/lib $(DNET_LIBS) $(MD_OS_LIBS) -lpcap
  77.  
  78. # The installed binary is owned by this group.
  79. GROUP = staff
  80. #have-bpf#GROUP = bpf
  81. #alpha-osf1v1#GROUP = system
  82. #alpha-osf1v2#GROUP = system
  83.  
  84. # Standard C compiler
  85. CC = cc
  86. #have-gcc#CC = gcc -g -Wall -Wmissing-prototypes -Wstrict-prototypes
  87. #alpha-osf1v1#CC = cc -g3
  88.  
  89. MAKE = make
  90.  
  91. # Explicitly define compiliation rule since SunOS 4's make doesn't like gcc.
  92. # Also, gcc does not remove the .o before forking 'as', which can be a
  93. # problem if you don't own the file but can write to the directory.
  94. .c.o:
  95.     rm -f $@; $(CC) $(CFLAGS) -c $*.c
  96.  
  97. CSRC =    tcpdump.c addrtoname.c \
  98.     print-ether.c print-ip.c print-arp.c print-tcp.c print-udp.c \
  99.     print-atalk.c print-domain.c print-tftp.c print-bootp.c print-nfs.c \
  100.     print-icmp.c print-sl.c print-ppp.c print-rip.c \
  101.     print-snmp.c print-ntp.c print-null.c print-egp.c print-ospf.c \
  102.     print-fddi.c print-llc.c print-sunrpc.c \
  103.     print-wb.c print-decnet.c print-isoclns.c print-ipx.c \
  104.     util.c bpf_dump.c parsenfsfh.c
  105. GEN =    version.c
  106.  
  107. SRC =    $(CSRC) $(GEN)
  108. ALLSRC = \
  109.     $(CSRC)
  110.  
  111. OBJ =    $(SRC:.c=.o)
  112.  
  113. HDR =    addrtoname.h appletalk.h bootp.h decnet.h \
  114.     ethertype.h extract.h fddi.h interface.h llc.h mib.h \
  115.     nfsv2.h ntp.h ospf.h nfsfh.h ipx.h
  116. MDHDR =    md-hp300.h md-sun3.h md-sun4.h md-mips.h md-vax.h md-rt.h md-alpha.h \
  117.     md-i386.h
  118. OSHDR =    os-bsd.h os-sunos3.h os-sunos4.h os-sunos5.h os-ultrix4.h os-osf1v1.h \
  119.     os-osf1v2.h os-irix4.h os-irix5.h
  120.  
  121. TAGHDR = \
  122.     /usr/include/netinet/in.h \
  123.     /usr/include/netinet/udp.h \
  124.     /usr/include/netinet/tcp.h \
  125.     /usr/include/arpa/tftp.h \
  126.     /usr/include/netinet/if_ether.h
  127.  
  128. TAGFILES = \
  129.     $(SRC) $(HDR) md.h os.h $(TAGHDR)
  130.  
  131. AWKS =    atime.awk packetdat.awk send-ack.awk stime.awk
  132.  
  133. TARFILES = \
  134.     README CHANGES INSTALL VERSION Makefile.in tcpdump.1 makemib mkdep \
  135.     $(ALLSRC) $(HDR) $(MDHDR) $(OSHDR) \
  136.     $(AWKS) configure
  137.  
  138. tcpdump: $(OBJ)
  139.     $(CC) $(CFLAGS) -o $@ $(OBJ) $(LIBS)
  140.  
  141. tcpcomp: tcpcomp.o bpf_dump.o util.o
  142.     $(CC) $(CFLAGS) -o $@ tcpcomp.o bpf_dump.o util.o $(LIBS)
  143.  
  144. version.o: version.c
  145. version.c: VERSION
  146.     rm -f version.c
  147.     cat VERSION | sed 's/.*/char version[] = "&";/' > version.c
  148.  
  149. install: force
  150.     rm -f $(DESTDIR)$(BINDEST) $(DESTDIR)$(MANDEST)
  151.     cp tcpdump $(DESTDIR)$(BINDEST)
  152.     chmod 550 $(DESTDIR)$(BINDEST)
  153.     chgrp $(GROUP) $(DESTDIR)$(BINDEST)
  154.     cp tcpdump.1 $(DESTDIR)$(MANDEST)
  155.  
  156. lint:    $(GEN) force
  157.     lint -hbxn $(SRC) | \
  158.         grep -v 'struct/union .* never defined' | \
  159.         grep -v 'possible pointer alignment problem'
  160.  
  161. clean:
  162.     rm -f $(OBJ) tcpdump tcpcomp tcpcomp.o $(GEN)
  163.  
  164. realclean:
  165.     rm -f $(OBJ) tcpdump tcpcomp tcpcomp.o $(GEN) md.h os.h libpcap Makefile tags
  166.  
  167. tags:    $(TAGFILES)
  168.     ctags -wtd $(TAGFILES)
  169.  
  170. tar:    $(GEN) force
  171.     @cwd=`pwd` ; dir=`basename $$cwd` ; name=tcpdump-`cat VERSION` ; \
  172.         list="" ; tar="tar cf" ; \
  173.         for i in $(TARFILES) ; do list="$$list $$name/$$i" ; done; \
  174.         echo \
  175.         "rm -f ../$$name; ln -s $$dir ../$$name" ; \
  176.          rm -f ../$$name; ln -s $$dir ../$$name ; \
  177.         echo \
  178.         "(cd .. ; $$tar - [lots of files]) | compress > /tmp/$$name.tar.Z" ; \
  179.          (cd .. ; $$tar - $$list) | compress > /tmp/$$name.tar.Z ; \
  180.         echo \
  181.         "rm -f ../$$name" ; \
  182.          rm -f ../$$name
  183.  
  184. force:    /tmp
  185. depend:    $(GEN) force
  186.     ./mkdep $(DEFINES) $(INCLUDES) $(SRC)
  187.